Fix for SWs with same Action= shadowing each other - #69
Conversation
SWs that have the same Action type shadow each other due to pulling which superweapon the player is targeting via `From_Action`, which only returns the first entry that matches the action. This adds new player state that tracks what the last SW the player started targeting and uses that instead.
|
Line 721 in e67c749 this could also be relevant in the future but it doesnt seem to affect anything noticeable right now. edit: well it's entirely unused anyway actually so it's weird, whatever lol |
|
Very nice improvement for sure. Great work! Few considerations to take into account:
|
loose fields on i dont think Vinifera made a fix for this, at least it's not mentioned in changelogs / documentation anywhere it seems. AI seems to think Vinifera's reimplemented sidebar maybe could have fixed it, which sounds somewhat plausible. either way, can you double-check how DTA is doing that in that context? because it seems like it probably didnt patch that and is doing something else interesting. apparently it's common to use an EMP SW as an extra alternative and i found that being mentioned in a super old Vini issue but no idea if that's relevant to what you're describing also traced by AI but: game AI has a totally different codepath for using / targeting(?) their SWs and from what i can tell actually doesnt have the same bug, so whatever changes to AI targeting superweapons that may want to be made should be for another PR probably? i did actually also miss a few things so i'll probably make another commit to this to patch up a few areas. there's other places |
Turns out it's multiple SWs with the same However, I did notice that if the player fires multiple SW in a very short amount of time, it will cause the coordinates of the targeting to be overridden, making 2 or more of the missiles hit the same coordinate instead of what the player actually did. However, it does mean you have to do it very quickly to see this bug. Possibly your changes will also fix that? |
|
im not 100% sure on that, all i have changed here is how the SW being used for targeting gets piped into the event, in theory that kind of setup should just be identical to how this would function, but just this doesnt need to do a workaround like that (and would not be limited by how many Action types there are). |
Summary
SWs that have the same Action type shadow each other due to pulling which superweapon the player is targeting via
From_Action, which only returns the first entry that matches the action. This adds new player state that tracks what the last SW the player started targeting and uses that instead. The new state gets cleaned up when the SW fires or the player clears the targeting mode. The value gets initialized and serializes.Behavior and compatibility
This should remain fully backwards compatible, no changes to vanilla rules needed for it to continue working as expected.
Validation
Player having access to multiple Superweapons with the same Action= at the same time should now work properly.
Documentation
N/A
Checklist